//接口类型定义
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export interface Result<T = any> {
  code: number
  data: T
  msg: string
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export interface ResultData<T = any> {
  list: T[]
  page: {
    pageNum: number
    pageSize: number
    total: number | 0
  }
}
export interface PageParams {
  pageNum: number | undefined
  pageSize?: number | undefined
}
// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace Login {
  export interface params {
    userName: string
    userPwd: string
  }
}
//用户管理
// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace User {
  export interface Params extends PageParams {
    userId?: number
    userName?: string
    state?: number
  }
  export interface UserItem {
    userImg: string
    _id: string
    userId: number
    userName: string
    userEmail: string
    mobile: string
    deptId: string
    deptName: string
    job: string
    state: number
    role: number
    createId: number
    roleList: string
  }
  export interface CreateParams {
    userName: string
    userEmail: string
    mobile: string
    deptId: string
    deptName: string
    job: string
    state: number
    roleList: string[]
    userImg: string
  }
  export interface EditParams extends CreateParams {
    userId: number
  }
}

// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace Dashboard {
  export interface ReportData {
    driverCount: number
    totalMoney: number
    orderCount: number
    cityNum: number
  }
  export interface LineData {
    label: string
    order: number
    money: number
  }
  export interface PieData {
    value: number
    name: string
  }
  export interface RadarData {
    indicator: Array<{ name: string; max: number }>
    data: { name: string; value: number[] }
  }
}
//部门管理
// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace Dept {
  export interface Params {
    deptName?: string
  }
  export interface CreateParams {
    parentId?: string
    deptName: number | string
    userName: string
  }
  export interface EditParams extends CreateParams {
    _id: string
  }
  export interface DeptItem extends CreateParams {
    _id: string
    userId?: number
    createTime: string
    updateTime: string
    children?: DeptItem[]
  }
  export interface DelItem {
    _id: string
  }
}

// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace Menu {
  export interface Params {
    menuName: string
    menuState: number
  }
  export interface CreateParams {
    menuName: string
    icon?: string
    menuType: number
    menuState: number
    menuCode?: string
    parentId?: string
    path?: string
    component?: string
    orderBy?: number
  }
  export interface MenuItem extends CreateParams {
    _id: string
    createTime: string
    buttons?: MenuItem[]
    children?: MenuItem[]
  }
  export interface EditParams extends CreateParams {
    _id: string
  }
  export interface DelParams {
    _id: string
  }
}

//角色管理
// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace Role {
  export interface Params extends PageParams {
    roleName?: string
  }
  export interface CreateParams {
    roleName: string
    remark?: string
  }
  export interface RoleItem extends CreateParams {
    _id: string
    permissionList: {
      checkedKeys: string[]
      halfCheckedKeys: string[]
    }
    updateTime: string
    createTime: string
  }
  export interface EditParams extends CreateParams {
    _id: string
  }
  export interface DelParams {
    _id: string
  }
  export interface Permission {
    _id: string
    permissionList: {
      checkedKeys: string[]
      halfCheckedKeys: string[]
    }
  }
}
